/*
   Copyright (c) [2023] [魔凤啸天]
   [MFUI] is licensed under Mulan PSL v2.
   You can use this software according to the terms and conditions of the Mulan PSL v2. 
   You may obtain a copy of Mulan PSL v2 at:
            http://license.coscl.org.cn/MulanPSL2 
   THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.  
   See the Mulan PSL v2 for more details.  
*/
#pragma once
#include "checkbutton.hpp"

namespace MFUI{
	class RadioButton:public CheckButton{
		RadioButton *last,*next;
		protected:
		void _changed()override;
		~RadioButton()override;
		
		public:
		//触发时先取消其它的再激活自身
		RadioButton(SDL_Color back,bool v);
		//退出广播链（如果有）
		void disconnect();
		//next=b b->last=this 默认b不为空 禁止成环
		void connect(RadioButton* b);
		void connect(std::initializer_list<RadioButton*> b);
	};
}